﻿using System.Collections.Generic;
using Draco.OWF.Exceptions;
using Draco.OWF.Metadata.DataBinding;
using Draco.OWF.Metadata;

namespace Draco.OWF.RT.Impl
{
    public class Task : ITask
    {
        
        protected TaskStatus m_status = TaskStatus.Inactive;
        protected Stack<ActivityRuntimeException> m_Exceptions = new Stack<ActivityRuntimeException>();

        public string Id { get; set; }
        public ActivityModel Activity { get; set; }
        public BindingData Result { get; set; }
        public TaskStatus Status
        {
            get { return m_status; }
            set { m_status = value; }
        }

        /// <summary>
        /// RuntimeExceptions
        /// </summary>
        public Stack<ActivityRuntimeException> Exceptions
        {
            get { return m_Exceptions; }
        }

        public Task(ActivityModel activiy)
        {
            this.Activity = activiy;
        }

        public void Run(ITaskContext taskContext)
        {
            this.m_status = TaskStatus.Running;
            //Activity.ExecuteTask(taskContext);
        }
    }
}
